<template>
  <el-menu
      :default-active="this.path"
      router
      class="el-menu-vertical-demo"
     
      unique-opened
  >
    <div style="display: flex;align-items: left;justify-content: left;padding: 11px 0;">
      <img alt="" src="@/assets/image/logo.png" style="width: 120px;">
    </div>
    <el-menu-item index="/home">
        <i class="el-icon-s-home" style="font-size:15px;color: #143371;">首页</i>
    </el-menu-item>
    <el-submenu v-if="this.judgeIdentity()!==0" index="2">
        <template slot="title">
          <i class="el-icon-user-solid"></i>
          <span>用户管理</span>
        </template>
      <el-menu-item v-if="this.judgeIdentity()!==0" index="/stuinfo" ><span>学生信息</span></el-menu-item>
      <el-menu-item v-if="this.judgeIdentity()===2" index="/dormManagerInfo"><span>宿管信息</span></el-menu-item>
    </el-submenu>
    
    <el-submenu v-if="this.judgeIdentity()!==0" index="3">
        <template slot="title">
          <i class="el-icon-school"></i>
          <span>宿舍管理</span>
        </template>
     
      <el-menu-item v-if="this.judgeIdentity()===2" index="/buildingInfo"><span>楼宇信息</span></el-menu-item>
      <el-menu-item v-if="this.judgeIdentity()!==0" index="/roomInfo"><span>房间信息</span></el-menu-item>
      <el-menu-item v-if="this.judgeIdentity()===1" index="/VisitInfo"><span>访客管理</span></el-menu-item>
     
    </el-submenu>
    <el-submenu v-if="this.judgeIdentity()!==0" index="4">
        <template slot="title">
          <i class="el-icon-tickets"></i>
          <span>信息管理</span>
        </template>
       
        <el-menu-item v-if="this.judgeIdentity()!==0" index="/WeiguiInfo"><span>违规信息</span></el-menu-item>
        <el-menu-item v-if="this.judgeIdentity()===1" index="/HolidayInfo"><span>假期出入宿舍</span></el-menu-item>
        
     
    </el-submenu>
    <el-submenu v-if="this.judgeIdentity()===1" index="5">
        <template slot="title">
          <i class="el-icon-mouse"></i>
          <span>申请管理</span>
        </template>
      <el-menu-item v-if="this.judgeIdentity()===1" index="/absentRoomInfo"><span>缺勤申请</span></el-menu-item>
      <el-menu-item v-if="this.judgeIdentity()!==0" index="/repairInfo"><span>报修信息</span></el-menu-item>
    </el-submenu>
    
    <el-menu-item v-if="this.judgeIdentity()===0" index="/myRoomInfo">
      <i class="el-icon-school"></i>
      <span>我的宿舍</span>
    </el-menu-item>
    <el-menu-item v-if="this.judgeIdentity()===0" index="/applyabsentRoom">
      <i class="el-icon-postcard"></i>
      <span>缺寝申请</span>
    </el-menu-item>
    <el-menu-item v-if="this.judgeIdentity()===0" index="/applyRepairInfo">
        <i class="el-icon-files"></i>
      <span>报修申请</span>
    </el-menu-item>
    <el-menu-item v-if="this.judgeIdentity()===0" index="/applyhoildayInfo">
        <i class="el-icon-c-scale-to-original"></i>
      <span>假期出入宿舍登记</span>
    </el-menu-item>
   
    
  </el-menu>
</template>

<script>
export default {
  data(){
    return {
      path: this.$route.path,
      idt:window.localStorage.getItem('identity')
    }
  },
    methods:{
        judgeIdentity(){
          return parseInt(this.idt);
        }
    }
}
</script>

<style scoped>

span {
  color:#143371 ;
}

</style>